import sys
from dingtalkchatbot.chatbot import DingtalkChatbot
from dingtalkchatbot.chatbot import CardItem
from dingtalkchatbot.chatbot import ActionCard
# WebHook地址
webhook = 'https://oapi.dingtalk.com/robot/send?access_token=xx'
xiaoding = DingtalkChatbot(webhook) 

# ActionCard独立跳转消息类型
# macdown   支持@对应人+跳转所以选择macdown发送
user = sys.argv[1]
Mobiles = sys.argv[2]



xiaoding.send_markdown(title='重要告警', text='###  请用户:'+user+'及时查看相关告警\n'
                       '> ###  [重置屏蔽](http://url/alter/getReply/0)\n\n'
                       '> ###  [屏蔽告警10分钟](http://url/alter/getReply/600)\n\n'
                       '> ###  [屏蔽告警60分钟](http://url/alter/getReply/3600)\n\n'
                       '> ###  [当天早上8点前不在告警](http://url/alter/getReply/8)\n\n'
                       '> ###  [查看告警](http://url/alter/alterLastDate) \n'
                       '> ###  [过滤表](http://url/alter/filter) \n',
                       at_mobiles=[Mobiles])
